<template>
  <div>
    <md-dialog-confirm
      :md-active.sync="setting.active"
      :md-title="setting.title"
      :md-content="setting.content"
      :md-confirm-text="setting.confirmText"
      :md-cancel-text="setting.cancelText"
      @md-cancel="$emit('onCancel',setting)"
      @md-confirm="$emit('onConfirm',setting)"/>
  </div>
</template>

<script>
  export default {
    name: 'Confirm',
    props: ['request'],
    data: () => ({
      setting: {
        active: false,
        value: null,
        title: null,
        content: null,
        confirmText: '确认',
        cancelText: '取消',
        data: null,
        type: null // delete or done
      }
    }),
    methods: {
    /*    onConfirm () {
        this.request.onConfirm(this.setting.data)
        this.$emit('welcome')
      },
      onCancel () {
        this.request.onCnacel(this.setting.data)
      }, */
      setConfirm (option) {
        this.setting = option
      }
    }
  }
</script>
